<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box2 {
            /* 
            white-space设置网页如何处理空白
            可选值:
            normal  正常
            nowrap  不换行
            pre     保留空白
            */
            width: 200px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    </style>
</head>

<body>
    <div class="box2">asdasdasdasdasdasdasdasdassdasdasdasdasdasdasd</div>
</body>

</html>